import requests from '@/utils/request'

// GET /admin/product/getCategory1
// GET /admin/product/getCategory2/{category1Id}
// GET /admin/product/getCategory3/{category2Id}

// 请求一级分类
export const reqCategorylist1 = ()=> requests({url:'/admin/product/getCategory1',method:'get'});
// 请求二级分类
export const reqCategorylist2=(category1Id)=>requests({url:`/admin/product/getCategory2/${category1Id}`,method:'get'})
// 请求三级分类
export const reqCategorylist3=(category2Id)=>requests({url:`/admin/product/getCategory3/${category2Id}`,method:'get'})
// 获取属性列表 get /admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id}
export const reqCategoryAttrList=(category1Id,category2Id,category3Id)=>requests({url:`/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`,method:'get'})


// 添加属性  /admin/product/saveAttrInfo  post
export const addAttr=(data)=>requests({url:`/admin/product/saveAttrInfo`,method:'post',data})
// 删除属性
export const deleteATTR=(attrId)=>requests({url:`/admin/product/deleteAttr/${attrId}`,method:'delete'})